﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Resources;
using System.Globalization;
using System.Threading;
namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        int temp;
        public Form1()
        {
            InitializeComponent();
            temp = 0;
        }

        private void btnopennewform_Click(object sender, EventArgs e)
        {
            Form2 newform = new Form2();
            newform.Show();
           
          
        }

        private void btnChangeIcone_Click(object sender, EventArgs e)
        {
           
            this.Icon = Resource1.Icon1;

           
        }

        private void btnreseticone_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

        private void btnchangelanguage_Click(object sender, EventArgs e)
        {
            
            temp++;
            if (temp == 1)
            {
                if (comboBox1.SelectedItem.ToString() == "Nederlands")
                {
                    ChangeLanguage("nl-BE");
                }
                else
                {
                    ChangeLanguage("fr-BE");
                }
            }
            else 
            {

                ChangeLanguage("en");
                temp = 0;
            }

           



           /* Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-BE");
            Form1 ope = new Form1();
            ope.Show();*/
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           // comboBox1.Items.Add("English");
            comboBox1.Items.Add("Nederlands");
            comboBox1.Items.Add("French");
            comboBox1.SelectedIndex = 0;
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void btncallclass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }// end change lan
       
    }
}
